import 'package:flutter/widgets.dart';
import 'package:mobile_app.core/core/domain/entities/learning_content/collection_list_item/collection_list_item.dart';

String getCollectionFolderLocalizedTitle({
  required CollectionFolder collectionFolder,
  required BuildContext context,
}) {
  if (collectionFolder is InbuiltCollectionFolder) {
    final languageCode = Localizations.localeOf(context).languageCode;
    return collectionFolder.titles[languageCode]!;
  }

  if (collectionFolder is CustomCollectionFolder) {
    return collectionFolder.title;
  }

  throw UnimplementedError();
}
